#include <iostream>
namespace CERT_FILE_PTR_DEREF_CAST {

	namespace bad {
		typedef FILE file4;
		typedef file4 file3;
		typedef file3 file2;
		typedef file2 file;

#define FILE_ALIAS FILE

		void func13_cast_to_file_pointer(void* p)
		{
			FILE file_a;
			file_a = *((FILE*)p);
			file_a = *((file*)p);
			file_a = *((FILE_ALIAS*)p);
		}
	
	}


	namespace good {

		typedef FILE file4;
		typedef file4 file3;
		typedef file3 file2;
		typedef file2 file;

#define FILE_ALIAS FILE

		void func13_cast_to_file_pointer(void* p)
		{
			FILE* file_a;
			file_a = ((FILE*)p);
			file_a = ((file*)p);
			file_a = ((FILE_ALIAS*)p);
		}
	}
}